package rinpu.springtest.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import rinpu.springtest.pojo.entity.Permission;
import rinpu.springtest.mapper.PermissionMapper;
import rinpu.springtest.service.PermissionService;
import rinpu.springtest.utils.StringUtils;

import java.util.ArrayList;
import java.util.List;


/**
 * @Author Rin_pu
 * @Date 2025/9/21 20:02
 * @Description PermissionServiceImpl 权限ServiceImpl
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission>
        implements PermissionService {


    @Override
    public List<Permission> getPermissionListByRoleIds(List<Long> ids) {
        if (StringUtils.isNull(ids) || ids.isEmpty()) {
            return new ArrayList<>();
        }
        return baseMapper.selectPermissionListByRoleIds(ids);
//        return baseMapper.selectList(new LambdaQueryWrapper<Permission>()
//                .in(Permission::getId, ids));
//        return baseMapper.selectByIds(ids);
    }

}
